﻿using DevExpress.XtraEditors;
using System;
using System.Windows.Forms;
using DevExpress.XtraReports.UI;

namespace QuanLyKhachSan
{
    public partial class frmInThietBiPhong : XtraForm
    {
        public frmInThietBiPhong()
        {
            InitializeComponent();
        }
        private void frmInThietBiPhong_Load(object sender, EventArgs e)
        {
            this.loaiPhongTableAdapter.Fill(this.qLKHACHSANDataSet.LoaiPhong);
            cbLoaiPhong.SelectedIndex = -1;
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (cbLoaiPhong.SelectedIndex==-1)
            {
                MessageBox.Show("Chưa chọn loại phòng để in");
            }
            else
            {
                string LoaiPhong = cbLoaiPhong.SelectedValue + "";
                string TenLoaiPhong = cbLoaiPhong.Text;
                XrptThietBiPhong rptThietBi = new XrptThietBiPhong(LoaiPhong,TenLoaiPhong);
                rptThietBi.CreateDocument();
                rptThietBi.ShowPreview();
                this.Close();
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
